﻿<!-- 
// Copyright 2010 Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
// INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR
// CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.

// See the Apache 2 License for the specific language governing
// permissions and limitations under the License. -->
<UserControl 
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 
    xmlns:my="clr-namespace:TheFactorM.Federation"  
    x:Class="TheFactorM.Federation.AccessControlServiceSignIn"
    xmlns:basic="clr-namespace:TheFactorM.Federation"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
     d:DesignWidth="480" >

    <UserControl.Resources>
        <ResourceDictionary>
            <DataTemplate x:Key="ItemTemplate">
                <StackPanel Margin="0,0,0,25" Width="432">
                    <TextBlock Text="{Binding Name}" HorizontalAlignment="Left" FontSize="{StaticResource PhoneFontSizeExtraLarge}"  MouseLeftButtonDown="TextBlock_MouseLeftButtonDown" MouseLeftButtonUp="TextBlock_MouseLeftButtonUp" MouseLeave="TextBlock_MouseLeave"/>
                </StackPanel>
            </DataTemplate>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Margin="5"  >
        
        <StackPanel x:Name="progressBar" VerticalAlignment="Center" HorizontalAlignment="Center" Width="400">
            <TextBlock x:Name="progressBarLabel"
                           HorizontalAlignment="Center" 
                           Margin="0,0,0,6" 
                           FontSize="{StaticResource PhoneFontSizeMedium}" />
            <ProgressBar  IsIndeterminate="True"  />
        </StackPanel>

        <StackPanel x:Name="identityProviderDiscovery" Visibility="Collapsed" >
            <TextBlock Margin="5,5,5,20" Text="Log in the application with your account of choice" FontFamily="{StaticResource PhoneFontFamilyLight}" FontSize="{StaticResource PhoneFontSizeMediumLarge}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" />
            <Grid x:Name="HomeRealmSelection">
                <ListBox x:Name="IdentityProviderList" Grid.RowSpan="2" Margin="0,0,0,250" ItemTemplate="{StaticResource ItemTemplate}" ItemsSource="{Binding Collection}" SelectionChanged="IdentityProviderList_SelectionChanged" SelectionMode="Single" />
            </Grid>
        </StackPanel>
        
            <phone:WebBrowser x:Name="BrowserSigninControl" IsScriptEnabled="True" Visibility="Collapsed"  />
        
    </Grid>
</UserControl>
